package com.google.code.swingonfire.showcase.component.clock;

import java.awt.Component;
import java.util.TimeZone;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

public class TimeZoneRenderer extends DefaultListCellRenderer
{

    private static final long serialVersionUID = -1295797383684745540L;

    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
        boolean cellHasFocus)
    {
        TimeZone timeZone = (TimeZone) value;

        return super.getListCellRendererComponent(list, timeZone.getDisplayName(true, TimeZone.LONG), index,
            isSelected, cellHasFocus);
    }

}
